#include	<Application.h>
#include	<Window.h>
#include	<ScrollView.h>
#include	<File.h>

#define		kMSG_FIND							'find'
#define		DAT_ATTR_THREADNUM		"ThreadNum" /*int32*/

#include	"K2chTextView.cpp"

int
main(int argc, const char *argv[])
{
	const char *path = (argc == 2) ? argv[1]
									 : "/boot/home/config/settings/2chPositive/2chCache/pc5.2ch.net/os/1086358637.dat";
	BApplication app("application/x-vnd.undefine-main2ch");

	BRect frame(0, 0, 640, 480);
	BWindow*
	fWindow = new BWindow(frame, "2ch:debug", B_DOCUMENT_WINDOW, B_QUIT_ON_WINDOW_CLOSE);

	frame.right	 -= B_V_SCROLL_BAR_WIDTH;
//frame.bottom -= B_H_SCROLL_BAR_HEIGHT;
	K2chTextView*
	m2ch = new K2chTextView(frame, "2ch:TextView", frame.InsetByCopy(3, 3),
													B_FOLLOW_ALL, B_WILL_DRAW);
	BFile file(path, B_READ_ONLY);
	m2ch->SetText(&file);
	fWindow->AddChild(new BScrollView("2ch:scroll", m2ch,
					 					B_FOLLOW_ALL, B_WILL_DRAW, false, true));
	fWindow->MoveTo(100, 100);
	fWindow->Show();
	
	app.Run();
}
